package com.bytezero.thistest;

public class Boy 
{
	private String name;
	private int age;
	
	//构造器
	public Boy()
	{
		
	}

	public Boy(String name)
	{
		
		this.name = name;
	}
	public Boy(int age)
	{
		this.age = age;
	}
	public Boy(String name,int age)
	{
		this.name = name;
		this.age = age;
	}




	//set  get
	public void setName(String name)
	{
		this.name = name;
	}
	public String getName()
	{
		return name;
	}
	
	public void setAge(int age)
	{
		this.age = age;
	}
	public int getAge()
	{
		return age;
	}
	
	//方法
	public void marry(Girl girl)
	{
		System.out.println("我想娶"+girl.getName());
	}
	
	public void shout()
	{
		if(this.age >= 22)
		{
			System.out.println("可以登记 结婚");
		}
		else
		{
			System.out.println("不可以登记");
		}
	}
	
	
	
}

























